namespace org.jawk.util
{
	/// <summary>A stack-like interface.</summary>
	/// <remarks>
	/// A stack-like interface.
	/// <p>
	/// Unfortunately, java.util.Stack uses a Vector, and is,
	/// therefore, needlessly synchronized in a non-multi-threaded
	/// environment.  As a result, it was necessary to reimplement the
	/// stack in this manner by using a non-synchronized list.
	/// </remarks>
	public interface IMyStack<E>
	{
		/// <summary>Push an item onto the stack.</summary>
		/// <remarks>Push an item onto the stack.</remarks>
		/// <param name="o">The item to push onto the stack.</param>
		void Push(E o);

		/// <summary>
		/// Pop an item off the stack and return that item
		/// to the callee.
		/// </summary>
		/// <remarks>
		/// Pop an item off the stack and return that item
		/// to the callee.
		/// </remarks>
		/// <returns>
		/// The top of the stack, which is subsequently
		/// removed from the stack.
		/// </returns>
		E Pop();

		/// <returns>The number of elements within the stack.</returns>
		int Size();

		/// <summary>Eliminate all items from the stack.</summary>
		/// <remarks>Eliminate all items from the stack.</remarks>
		void Clear();

		/// <summary>Inspect the top-most element without affecting the stack.</summary>
		/// <remarks>Inspect the top-most element without affecting the stack.</remarks>
		E Peek();
	}
}
